
echo off
REM *************************************************************************************
REM The File is tested in folder c:/testtfs
REM 
REM http://msdn.microsoft.com/en-us/library/z51z7zy0%28v=vs.100%29.aspx
REM
REM
REM *************************************************************************************

echo on

setlocal

SET CurrentFolder=%~dp0

SET TF="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe"

SET MyCommand="get /all"
SET SourceFolder=%Currentfolder%source
SET MyLogin=/login:snd\XXXXXXXX,XXXXXXXXX
SET TfsServer=https://tfs.codeplex.com/tfs/tfs13
SET MyTestWorkSpaceName="testworkspace"
SET %MyCollection%=%TfsServer%

rmdir %SourceFolder% /q/s
mkdir %SourceFolder%


%TF% workspaces /server:%TfsServer%  /format:detailed %MyLogin%

pause

%TF% workspace /noprompt /delete %MyTestWorkspaceName%

%TF% workspaces /server:%TfsServer%  /format:detailed %MyLogin%

pause


cd %SourceFolder%
%TF% workspace /noprompt /new /collection:%TfsServer% /permission:Public %MyTestWorkspaceName%
cd %CurrentFolder%

%TF% workspaces /server:%TfsServer%  /format:detailed %MyLogin%
pause

%TF% get %SourceFolder% /recursive

pause
